
<?php
    echo $this->Html->link(
                        'Create Survey', 
                        array('controller' => 'WebSurveys', 'action' => 'create'));
     
?>

<table>
    <tr>
        <th>Name</th>
        <th>Edit</th>
        <th>Publish</th>
        <th>Analyze</th>
    </tr>
    <!-- Here is where we loop through our $surveys array, printing out survey info -->
    <?php foreach ($websurveys as $websurvey): ?>
        <tr>
            <td><?php echo $websurvey['WebSurvey']['name']; ?></td>
            <td><?php echo $this->Html->image('edit.png', 
                                              array('alt' => 'Edit', 
                                                    'url' => array('controller' => 'WebSurveys',
                                                                    'action'=> 'edit',
                                                                    $websurvey['WebSurvey']['id'])));?></td>                                           
            <td><?php echo $this->Html->image('edit.png', 
                                              array('alt' => 'Publish', 
                                                    'url' => array('controller' => 'WebSurveys',
                                                                    'action'=> 'publish',
                                                                    $websurvey['WebSurvey']['id'])));?></td>                             
            <td><?php echo $this->Html->image('edit.png', 
                                              array('alt' => 'Analyze', 
                                                    'url' => array('controller' => 'WebSurveys',
                                                                    'action'=> 'analyze',
                                                                    $websurvey['WebSurvey']['id']))); 
            
            ?></td>                             
        </tr>
    <?php endforeach; ?>
<?php unset($websurveys); ?>
</table>
